
using System;
using System.Text;

namespace T2.WebSecurity.ASPMVC.Entity.Translators
{

    public static class TranslatorHelper
    {
        public static string TranslateTimeStampFromBusiness(byte[] _param)
        {
            StringBuilder retVal = new StringBuilder();
            

            for (int i = 0; i < _param.Length; i++)
            {
                retVal.Append(_param[i].ToString());
                if (i < 8)
                {
                    retVal.Append("-");
                }
            }

            return retVal.ToString();
        
        }
    
    
    
    


        public static byte[] TranslateTimeStampToBusiness(string _param)
        {

            byte[] retVal = new byte[8];
            int ctr = 0;
            char[] sep = new char[]{'-'};

            string[] tempString = _param.Split(sep);
            foreach (string item in tempString)
            {
                if (item != string.Empty)
                {
                    retVal[ctr] = Convert.ToByte(item);
                }
                ctr++;
            }

            
            return retVal;


        }
    }


}